#-------------------------------------------------------------------------------
# Name:        Hangman
# Purpose:
#
# Author:      Ahad
#
# Created:     30/07/2012
# Copyright:   (c) Student 2012
# Licence:     <your licence>
#-------------------------------------------------------------------------------
import random

def main():

    print("----------------Hangman----------------")
    print("------10 Strikes and you're out!-------")

    listOfWords = [ "programming", "technology", "dinosaur", "pterodactyl", "murburger"]
    word = random.choice(listOfWords)
    guess = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z"
    turns = 7

    while turns > 0:
        wrongAnswer = 0
        for letter in word:
            if letter in guess:
                print (letter)
            else:
                print ("_"),
                wrongAnswer += 1
        if wrongAnswer == 0:
            print ("CONGRATULATIONS YOU WIN!!!")

        guess = input("Guess a letter:  ")
        guess+=guess
        if guess not in word:
            turns-=1

            print ("Incorrect, a body part as been hung")
            print (turns, " more turns")
            if turns == 0:
                print ("The word is ", word)
if __name__ == '__main__':
    main()
